package com.wayne.oauth2.controller;

import com.wayne.oauth2.entity.Order;
import com.wayne.oauth2.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/{id}")
    public Order selectProductById(@PathVariable("id") Integer id) {
        return orderService.selectOrderById(id);
    }

    @GetMapping("/index")
    public String index() {
        return "order index";
    }
}
